package model

import "gorm.io/gorm"

// User todo 表结构对应的结构体
type User struct {
	gorm.Model
	Id int
	Sex int8
	Name string
	Pass string
}

func FindUserById(id int) (*User, int) {
	user := new(User)
	tx := db.Debug().Where("id = ?", id).Unscoped().Find(user)
	return user, int(tx.RowsAffected) // 结构体和影响的行数
}
